import { useState, useEffect } from "react";
import { getChannelAPI } from "@/apis/article";

export function useChannel() {
  const [channelList, setChannelList] = useState([]);
  async function getChannelList() {
    const res = await getChannelAPI();
    setChannelList(res.data.channels);
  }
  useEffect(() => {
    getChannelList();
  }, []);
  return { channelList };
}
